<template>
	<view class="qilin-box">
		<personal-header @change="changeTab"></personal-header>
		<personal-list v-if="index==1 || index==3"></personal-list>
		<follow-list v-else :list="list" type="personal"></follow-list>
		<tab-bar></tab-bar>
	</view>
</template>

<script>
	import TabBar from "../../components/tabBar.vue";
	import PersonalHeader from "../../components/personalHeader.vue";
	import PersonalList from "../../components/personalList.vue";
	import FollowList from "../../components/followList.vue";
	export default {
		components:{
			TabBar,
			PersonalHeader,
			PersonalList,
			FollowList
		},
		data() {
			return {
				index:1,
				list:[]
			}
		},
		methods: {
			//当点击子组件切换tab时触发
			changeTab(index){
				this.index=index;
			},
			getVideo(){
				uni.request({
					url:"http://localhost:9999/api/videos.json",
					method:"get",
					success:(res)=>{
						this.list=res.data.list.slice(0,3);
					}
				});
			}
		},
		mounted(){
			this.getVideo();
		}
	}
</script>

<style>
.qilin-box{
	width:100%;
	min-height:100%;
	/* height:100%; */
	background-color:#181725;
}
</style>
